Add Exchange before GroupId to improve Partial Aggregation#24047
Add Exchange before GroupId to improve Partial Aggregation#24047aaneja merged 1 commit intoprestodb:masterfrom
Conversation
95fb49c to
62aaab6
Compare
|
Thanks for the release note entry! Minor formatting nits, and include the PR number. |
62aaab6 to
fa61dfd
Compare
fa61dfd to
39222b3
Compare
86b145a to
5868a2f
Compare
ZacBlanco
left a comment
There was a problem hiding this comment.
high level first pass. Seems good for the most part. I will take another pass and look at the details of the rule tomorrow.
5868a2f to
437a09a
Compare
There was a problem hiding this comment.
maybe this should have 3 possible values - ALWAYS, COST_BASED, and NEVER (similar to partial aggregation pushdown). that way someone can enable this if they don't have stats or if the stats estimates are no good.
There was a problem hiding this comment.
What would we re-partition on if ALWAYS is chosen (for the non-trivial case of more than one partition variable) ?
There was a problem hiding this comment.
good point. i guess we can leave as is for now, unless we want to has on all of them?
There was a problem hiding this comment.
I'm in favor of leaving this as-is until a use case arises for ALWAYS
There was a problem hiding this comment.
what about a withProjection test. Also a test that it doesn't fire if it's disabled, only has one grouping set, has pass through keys.
There was a problem hiding this comment.
'only has one grouping set' , added with this test
withProjection, does not fire if disabled -> will add
only has one grouping set, has pass through keys -> I could not build a use-case where this occurs. My understanding of when this could occur is unclear. Can you help me out with an example ?
There was a problem hiding this comment.
sorry, i didn't mean one grouping set with pass through keys, i meant the case covered by https://github.com/prestodb/presto/pull/24047/files#diff-2e788a27c31ea3e4d5d404dba18eee33a3868d656bae3b0c0380269afb838f24, so multiple grouping sets that all share some common keys.
There was a problem hiding this comment.
@rschlussel I think I've covered all the test cases now. Please take a look
437a09a to
979d204
Compare
The minor formatting nits should still apply, but new release note guidelines as of last week: PR #24354 automatically adds links to this PR to the release notes. Please remove the manual PR link in the following format from the release note entries for this PR. I have updated the Release Notes Guidelines to remove the examples of manually adding the PR link. |
|
@steveburnett Thanks for the feedback! We're still working through some naming+defaults for the new session/feature flags. I will update the release notes + optimizer docs once we close on this |
0874d82 to
f95fab9
Compare
e196f21 to
74178b4
Compare
There was a problem hiding this comment.
I noticed that we only create a GroupId node iff the size of the grouping sets is >1. So adding this invariant here, made sense. No tests failed, so IMO this should be added cc: @rschlussel
Based on: trinodb/trino@dc1d66fb co-authored-by: Piotr Findeisen <piotr.findeisen@gmail.com> Based on : trinodb/trino@c573b34 co-authored-by: Lukasz Stec <lukasz.stec@starburstdata.com> Based on: trinodb/trino@29328d3 co-authored-by: praveenkrishna <praveenkrishna@tutanota.com>
74178b4 to
84cafec
Compare
See #23475 for more details
Previously closed PR - #11741
Description
Motivation and Context
See Javadoc of the new
AddExchangesBelowPartialAggregationOverGroupIdRuleSetImpact
Better performance for TPCDS Q22, Q67
See plan diffs (TPCDS SF 1000, unpartitioned) - https://aaneja.github.io/mypages/PR_24047_AddExchangesBelowPartialAggregationOverGroupId_OffVsOn.html
Test Plan
TODO : Add a new planner test
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.